/*
frigOS
Licensed under GPLv3
*/

#include "shared_memory.h"
#include "serial.h"
#include "kernel.h"

volatile uint8_t shared_usart0_rx_buffer[USART0_RX_BUFFER_SIZE];
volatile uint8_t shared_usart0_rx_buffer_length;

volatile uint8_t shared_usart1_rx_buffer[USART1_RX_BUFFER_SIZE];
volatile uint8_t shared_usart1_rx_buffer_length;

volatile Semaphore shared_usart0_rx_buffer_lock;
volatile Semaphore shared_usart1_rx_buffer_lock;

void initSharedMemory() {
    initSemaphore(&shared_usart0_rx_buffer_lock, 1);
    initSemaphore(&shared_usart1_rx_buffer_lock, 1);

    shared_usart0_rx_buffer_length = 0;
    shared_usart1_rx_buffer_length = 0;

}
